package com.wulian.common.euums;

/**
 * @BelongsProject: yc-parent
 * @BelongsPackage: com.wulian.other.dto
 * @Author: gaoshaomeng
 * @CreateTime: 2019-12-18 10:52
 * @Description: ${Description}
 */
public enum AppErrorCodeEnum {
    //数据结构
    ERROR_30000_PARAM("参数错误",30000),
    ERROR_30001_LOGIN("登陆失败用户名或密码错误",30001),
    ERROR_30002_INNER("服务器内部错误，请联系管理员",30002),
    ERROR_30003_NULL("不存在数据",30003),
    ERROR_30004_INNER_OR_NULL("不存在数据或者服务器内部错误，请联系管理员",30004),
    ERROR_30005_NOT_ALLOWED("姓名没有改变，不允许修改",30005),
    ERROR_30012_OTHER("您还有未结束的巡检，无法继续新增",30012),
    ERROR_30013_FORMAT("文件格式不符合要求",30013),
    ERROR_30014_FORMAT("该污水厂今天已经提交过了",30014);

    private String describe;
    private int errorCode;

    private AppErrorCodeEnum(String describe, int errorCode){
        this.describe = describe;
        this.errorCode = errorCode;
    }
    public String getDescribeByCode(int errorCode){
        for (AppErrorCodeEnum appErrorCode:AppErrorCodeEnum.values()) {
            if(appErrorCode.errorCode == errorCode){
                return appErrorCode.describe;
            }
        }
        return null;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }
}
